/*********************************************************************
 *                                                                   *
 *  Js Css Minifier ( JsCssMin )                                     *
 *  Author: Igor Kanshyn                                             *
 *  Copyright (c) 2009, Igor Kanshyn. All rights reserved.           *
 *                                                                   *
 *  JsCssMin is released under the Apache Software License.          *
 *  See LICENSE.txt for more details.                                *
 *                                                                   *
 *********************************************************************/

package org.grenader.jscssmin.files;

import org.grenader.jscssmin.FileTestCaseBase;
import static org.junit.Assert.assertEquals;
import org.junit.Test;

import java.io.File;
import java.io.IOException;

/**
 * <p>Product: JsCssMin ( JavaScript and CSS Minifier )<br>
 * Author: Igor Kanshyn (grenader).
 * </p>
 * Date: Apr 26, 2009
 */
public class FileUtilsTestCase extends FileTestCaseBase {

    @Test
    public void testReadFileContent_encoding() throws IOException {
        String content = FileUtils.readFileContent(new File(currentClassDirPath, "/files/data-file-Cp1251.txt"), "Cp1251");
        assertEquals("Русский текст\n" +
                "Второй русский текст\n", content);
    }

    @Test
    public void testCopy2() throws IOException {
        File in1 = new File(currentClassDirPath, "my.css");
        File in2 = new File(currentClassDirPath, "my.js");
        File out = new File(tmpDestinatonDir, "my.js-css");

        FileUtils.copyTwoFileIntoOne(in1, in2, out);
    }


}
